<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/public/head.jsp" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>会员钱包后台管理系统</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="${system}/static/favicon.ico">
    <link href="${system}/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${system}/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${system}/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <!-- Morris -->
    <link href="${system}/static/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="${system}/static/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

    <link href="${system}/static/css/animate.css" rel="stylesheet">
    <link href="${system}/static/css/style.css?v=4.1.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="${system}/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">


    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>支付信息</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>支付ID</th>
                            <th>姓名</th>
                            <th>手机号</th>
                            <th>贷款金额</th>
                            <th>贷款时间</th>
                            <th>利息</th>
                            <th>会员支付金额</th>
                            <th>会员支付状态</th>
                            <th>修改支付状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="pay" items="${paymentInformation}">
                            <tr class="gradeA">
                                <td>${pay.re_id}</td>
                                <td>${pay.authentication.auth_user_name}</td>
                                <td>${pay.user.user_number}</td>
                                <td>${pay.byStages.bs_loan}</td>
                                <th><fmt:formatDate value="${pay.byStages.bs_time}" pattern="yyyy-MM-dd"/></th>
                                <td>${pay.byStages.bs_interest}</td>
                                <td>${pay.re_money}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${pay.status==1}">
                                            <span style="color: #1dc5a3">已支付</span>
                                        </c:when>
                                        <c:otherwise>
                                            <span style="color: red">未支付</span>
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td>
                                    <span style="display: none">${pay.status==1?0:1}</span>
                                    <span style="cursor:pointer; color: #0e9aef;" name="status">修改支付状态</span>
                                    <span style="display: none">${pay.user_id}</span>
                                    <span style="display: none">${pay.re_id}</span>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>


</div>

<!-- 全局js -->
<script src="${system}/static/js/jquery.min.js?v=2.1.4"></script>
<script src="${system}/static/js/bootstrap.min.js?v=3.3.6"></script>

<script src="${system}/static/js/alert.js"></script>

<!-- Flot -->
<script src="${system}/static/js/plugins/flot/jquery.flot.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.spline.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.resize.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.pie.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.symbol.js"></script>

<!-- Peity -->
<script src="${system}/static/js/plugins/peity/jquery.peity.min.js"></script>
<script src="${system}/static/js/demo/peity-demo.js"></script>

<!-- 自定义js -->
<script src="${system}/static/js/content.js?v=1.0.0"></script>


<!-- jQuery UI -->
<script src="${system}/static/js/plugins/jquery-ui/jquery-ui.min.js"></script>

<!-- Jvectormap -->
<script src="${system}/static/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${system}/static/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>

<!-- EayPIE -->
<script src="${system}/static/js/plugins/easypiechart/jquery.easypiechart.js"></script>

<!-- Sparkline -->
<script src="${system}/static/js/plugins/sparkline/jquery.sparkline.min.js"></script>

<!-- Sparkline demo data  -->
<script src="${system}/static/js/demo/sparkline-demo.js"></script>

<script src="${system}/static/js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="${system}/static/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${system}/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>

<script>

    $(function () {
        $("[name='status']").click(function () {
            var user_id=$(this).next().text();
            var status=$(this).prev().text();
            var re_id=$(this).prev().next().next().next().text();
            swal({
                title: "确定修改?",
                type: "warning",
                showCancelButton: true,
                cancelButtonText: "取消",
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确认",
                closeOnConfirm: false
            }, function () {
                ajax("${system}/paymentInfo/modifyPayStatus",{"user_id":user_id,"status":status,"re_id":re_id},"text","post",true,function (data) {
                    switch (data) {
                        case "success":
                            swal({
                                title: "修改成功",
                                type: "success",
                                confirmButtonColor: "#9ACD32",
                                confirmButtonText: "OK",
                                closeOnConfirm: false
                            }, function () {
                                window.location.reload();
                            });
                            break;
                        case "fail":
                            swal("提示", "修改失败,请稍后再试！", "error");
                            break;
                        default:
                            swal("提示", "修改失败,请稍后再试！", "error");
                            break;
                    }
                },function (error) {
                   console.log(error)
                    swal("提示", "修改时出现问题,请稍后再试！", "error");
                })
            });
        });
    });


    $(document).ready(function () {
        $('.dataTables-example').dataTable();

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });

        
    });


</script>

</body>

</html>
